/*
	author:wuxl
*/

var config = {
	debug: true,
	mini: true,
	baseurl: '../themes/cwc/',
	less: {
		watch: ['css.less/**/*.less'],
		src: ['css.less/*.less'],
		dest: 'css.min'
	}
};
var gulp = require('gulp'),
	less = require('gulp-less');
//*****************************************************
process.chdir(config.baseurl);
console.log('改变工作目录to：%s', process.cwd());
//*****************************************************
gulp.task('watchLess', function() {
	gulp.watch(config.less.watch, function(event) {
		console.log('less改变了，重新生成css');
		gulp.src(config.less.src)
			.pipe(less())
			.pipe(gulp.dest(config.less.dest));
	});
});
//*****************************************************
gulp.task('default', ['watchLess']);